Introduction

As the last session, we will try to play a bit with single-cell RNAseq data. Most of you might already have single-cell RNAseq datasets, which are analysed by me or Ahmad at one point.

In this session, we will play a bit about single-cell RNAseq data, like changing the resolution and get the clusters and getting violin plot.

Installation of package

For single-cell RNAseq data analysis and plotting, we need some specific packages. We will install one by one.

Seurat

Seurat is the tools for the single-cell RNAseq data, covering from the pre-process to the downstream analysis. We will mainly use this package to proceed and calculate the UMAP.

install.packages('Seurat')

Depedencies

install.packages(c("patchwork", "data.table", "magrittr"))

When the packages are all installed, please attach them on your environment.

library(Seurat)
library(ggplot2)
library(patchwork)
library(tidyverse)
library(data.table)
library(magrittr)

Data preprocess

Here, we will not play with the data pre-process by our own. For the data pre-process, bioinformaticians mainly check the quality of data and trim out the bad quality of cells or reads. This is not recommended on your personal laptop, since it requires large capacity of memory.

Here, we will start from the data, which is already trimmed and ready to work on the process. This data is already including the linear dimensional reduction, so ready to define the cluster.

seuset <- readRDS("Preproceeded_scRNA.rds")
seuset
An object of class Seurat 
20043 features across 5566 samples within 1 assay 
Active assay: RNA (20043 features, 2000 variable features)
 1 dimensional reduction calculated: pca

Cluster the cells

On Seurat, it applies a graph-based clustering approach to define the cluster. Importantly, the distance metric which drives the clustering analysis (based on previously identified PCs) remains the same.

Seurat has two steps to cluster the cells. First step is constructing the KNN graph based ont he euclidean distance on PCA. Then, refine the edge weights between any two cells, based on the shared overlap in their local neighbourhood.

Decide dimensionality

Since Seurat uses the dimensions on the PCA to calculate cluster, so we will define how many of PCs to use for the definition of cluster on our sample.

Usually, we decide the number of PCs where the lower plateau starts to be sure. In other words, we choose the point where the variability is not too considerable. Here, we will take first 30 PCs for defining the cluster.

If we use more dimension it cause more clusters, this should be see more in detail. However, if you take too high dimension than the proper PCs, it will cause over-clustering or bring difficulties on the interpretation.

seuset <- FindNeighbors(seuset, dims = 1:30)
Computing nearest neighbor graph
Computing SNN

When the nearest neighbour is calculated based on the PCs we decided, we need to find the clusters with the specific resolutions you will apply. Resolution is same as the magnification of the lenses on the microscope, so if you set the high resolution, you will get more clusters with details.

For setting the resolution, you could test several different resolutions and then decide which one is the proper value for your data. Usually three to four values are tested, and check whether the clusters are too vague or over-clustered.

Here, we will put the value as 0.3 for practice.

seuset <- FindClusters(seuset, resolution = 0.3)
Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck

Number of nodes: 5566
Number of edges: 197064

Running Louvain algorithm...
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Maximum modularity in 10 random starts: 0.9618
Number of communities: 17
Elapsed time: 0 seconds

Run non-linear dimensional reduction (UMAP/tSNE)

Seurat offers several non-linear dimensional reduction techniques, such as tSNE and UMAP, to visualize and explore these datasets.

seuset <- RunUMAP(seuset, dims = 1:30)
Warning: The default method for RunUMAP has changed from calling Python UMAP via reticulate to the R-native UWOT using the cosine metric
To use Python UMAP via reticulate, set umap.method to 'umap-learn' and metric to 'correlation'
This message will be shown once per session
14:51:19 UMAP embedding parameters a = 0.9922 b = 1.112
14:51:19 Read 5566 rows and found 30 numeric columns
14:51:19 Using Annoy for neighbor search, n_neighbors = 30
14:51:19 Building Annoy index with metric = cosine, n_trees = 50
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
14:51:20 Writing NN index file to temp file /var/folders/fb/63zhxstn6bvc52qb8hgjc1c40000gn/T//Rtmpm8BWxh/file2d674de7d7a2
14:51:20 Searching Annoy index using 1 thread, search_k = 3000
14:51:21 Annoy recall = 100%
14:51:21 Commencing smooth kNN distance calibration using 1 thread
14:51:22 Initializing from normalized Laplacian + noise
14:51:22 Commencing optimization for 500 epochs, with 229372 positive edges
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
14:51:29 Optimization finished

To get the information of each cluster

When we run the analysis with Seurat, it includes the information of each cells in meta.data. We could check several informations, including which cells are annotated as which cluster or how many genes are detected in each cells.

Here, before moving on, we will check our meta.data.

For annotation of each cluster

Okay, now we have the clusters on the UMAP. However, we need to annotate which cluster is composed of which one. Seurat provides several different functions to get the idea, including visualisation of the gene expression.

Finding differentially expressed features

Seurat can help you find markers that define clusters via differential expression. By default, it identifies positive and negative markers of a single cluster, compared to all other cells.

seuset.markers <- FindAllMarkers(seuset, only.pos = TRUE, min.pct = 0.25, logfc.threshold = 0.25)
Calculating cluster 0

  |                                                  | 0 % ~calculating  
  |+                                                 | 1 % ~21s          
  |++                                                | 2 % ~32s          
  |++                                                | 3 % ~28s          
  |+++                                               | 4 % ~25s          
  |+++                                               | 5 % ~24s          
  |++++                                              | 6 % ~24s          
  |++++                                              | 7 % ~23s          
  |+++++                                             | 9 % ~24s          
  |+++++                                             | 10% ~24s          
  |++++++                                            | 11% ~23s          
  |++++++                                            | 12% ~23s          
  |+++++++                                           | 13% ~23s          
  |+++++++                                           | 14% ~22s          
  |++++++++                                          | 15% ~22s          
  |++++++++                                          | 16% ~21s          
  |+++++++++                                         | 17% ~21s          
  |++++++++++                                        | 18% ~20s          
  |++++++++++                                        | 19% ~20s          
  |+++++++++++                                       | 20% ~19s          
  |+++++++++++                                       | 21% ~19s          
  |++++++++++++                                      | 22% ~19s          
  |++++++++++++                                      | 23% ~19s          
  |+++++++++++++                                     | 24% ~18s          
  |+++++++++++++                                     | 26% ~18s          
  |++++++++++++++                                    | 27% ~18s          
  |++++++++++++++                                    | 28% ~18s          
  |+++++++++++++++                                   | 29% ~17s          
  |+++++++++++++++                                   | 30% ~17s          
  |++++++++++++++++                                  | 31% ~17s          
  |++++++++++++++++                                  | 32% ~16s          
  |+++++++++++++++++                                 | 33% ~16s          
  |++++++++++++++++++                                | 34% ~16s          
  |++++++++++++++++++                                | 35% ~15s          
  |+++++++++++++++++++                               | 36% ~15s          
  |+++++++++++++++++++                               | 37% ~15s          
  |++++++++++++++++++++                              | 38% ~14s          
  |++++++++++++++++++++                              | 39% ~14s          
  |+++++++++++++++++++++                             | 40% ~14s          
  |+++++++++++++++++++++                             | 41% ~14s          
  |++++++++++++++++++++++                            | 43% ~13s          
  |++++++++++++++++++++++                            | 44% ~13s          
  |+++++++++++++++++++++++                           | 45% ~13s          
  |+++++++++++++++++++++++                           | 46% ~12s          
  |++++++++++++++++++++++++                          | 47% ~12s          
  |++++++++++++++++++++++++                          | 48% ~12s          
  |+++++++++++++++++++++++++                         | 49% ~12s          
  |+++++++++++++++++++++++++                         | 50% ~11s          
  |++++++++++++++++++++++++++                        | 51% ~11s          
  |+++++++++++++++++++++++++++                       | 52% ~11s          
  |+++++++++++++++++++++++++++                       | 53% ~11s          
  |++++++++++++++++++++++++++++                      | 54% ~10s          
  |++++++++++++++++++++++++++++                      | 55% ~10s          
  |+++++++++++++++++++++++++++++                     | 56% ~10s          
  |+++++++++++++++++++++++++++++                     | 57% ~10s          
  |++++++++++++++++++++++++++++++                    | 59% ~09s          
  |++++++++++++++++++++++++++++++                    | 60% ~09s          
  |+++++++++++++++++++++++++++++++                   | 61% ~09s          
  |+++++++++++++++++++++++++++++++                   | 62% ~09s          
  |++++++++++++++++++++++++++++++++                  | 63% ~08s          
  |++++++++++++++++++++++++++++++++                  | 64% ~08s          
  |+++++++++++++++++++++++++++++++++                 | 65% ~08s          
  |+++++++++++++++++++++++++++++++++                 | 66% ~08s          
  |++++++++++++++++++++++++++++++++++                | 67% ~07s          
  |+++++++++++++++++++++++++++++++++++               | 68% ~07s          
  |+++++++++++++++++++++++++++++++++++               | 69% ~07s          
  |++++++++++++++++++++++++++++++++++++              | 70% ~07s          
  |++++++++++++++++++++++++++++++++++++              | 71% ~06s          
  |+++++++++++++++++++++++++++++++++++++             | 72% ~06s          
  |+++++++++++++++++++++++++++++++++++++             | 73% ~06s          
  |++++++++++++++++++++++++++++++++++++++            | 74% ~06s          
  |++++++++++++++++++++++++++++++++++++++            | 76% ~05s          
  |+++++++++++++++++++++++++++++++++++++++           | 77% ~05s          
  |+++++++++++++++++++++++++++++++++++++++           | 78% ~05s          
  |++++++++++++++++++++++++++++++++++++++++          | 79% ~05s          
  |++++++++++++++++++++++++++++++++++++++++          | 80% ~05s          
  |+++++++++++++++++++++++++++++++++++++++++         | 81% ~04s          
  |+++++++++++++++++++++++++++++++++++++++++         | 82% ~04s          
  |++++++++++++++++++++++++++++++++++++++++++        | 83% ~04s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 84% ~04s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 85% ~03s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 86% ~03s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 87% ~03s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 88% ~03s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 89% ~02s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 90% ~02s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 91% ~02s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 93% ~02s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 94% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 95% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 96% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=22s  
Calculating cluster 1

  |                                                  | 0 % ~calculating  
  |+                                                 | 1 % ~21s          
  |++                                                | 2 % ~22s          
  |++                                                | 3 % ~25s          
  |+++                                               | 4 % ~24s          
  |+++                                               | 5 % ~23s          
  |++++                                              | 6 % ~22s          
  |++++                                              | 7 % ~22s          
  |+++++                                             | 8 % ~21s          
  |+++++                                             | 9 % ~21s          
  |++++++                                            | 10% ~21s          
  |++++++                                            | 11% ~21s          
  |+++++++                                           | 12% ~21s          
  |+++++++                                           | 13% ~20s          
  |++++++++                                          | 14% ~20s          
  |++++++++                                          | 15% ~20s          
  |+++++++++                                         | 16% ~19s          
  |+++++++++                                         | 17% ~20s          
  |++++++++++                                        | 18% ~20s          
  |++++++++++                                        | 19% ~19s          
  |+++++++++++                                       | 20% ~19s          
  |+++++++++++                                       | 21% ~19s          
  |++++++++++++                                      | 22% ~19s          
  |++++++++++++                                      | 23% ~18s          
  |+++++++++++++                                     | 24% ~18s          
  |+++++++++++++                                     | 26% ~18s          
  |++++++++++++++                                    | 27% ~18s          
  |++++++++++++++                                    | 28% ~18s          
  |+++++++++++++++                                   | 29% ~18s          
  |+++++++++++++++                                   | 30% ~17s          
  |++++++++++++++++                                  | 31% ~17s          
  |++++++++++++++++                                  | 32% ~17s          
  |+++++++++++++++++                                 | 33% ~17s          
  |+++++++++++++++++                                 | 34% ~16s          
  |++++++++++++++++++                                | 35% ~16s          
  |++++++++++++++++++                                | 36% ~16s          
  |+++++++++++++++++++                               | 37% ~16s          
  |+++++++++++++++++++                               | 38% ~15s          
  |++++++++++++++++++++                              | 39% ~15s          
  |++++++++++++++++++++                              | 40% ~15s          
  |+++++++++++++++++++++                             | 41% ~14s          
  |+++++++++++++++++++++                             | 42% ~14s          
  |++++++++++++++++++++++                            | 43% ~14s          
  |++++++++++++++++++++++                            | 44% ~13s          
  |+++++++++++++++++++++++                           | 45% ~13s          
  |+++++++++++++++++++++++                           | 46% ~13s          
  |++++++++++++++++++++++++                          | 47% ~13s          
  |++++++++++++++++++++++++                          | 48% ~12s          
  |+++++++++++++++++++++++++                         | 49% ~12s          
  |+++++++++++++++++++++++++                         | 50% ~12s          
  |++++++++++++++++++++++++++                        | 51% ~12s          
  |+++++++++++++++++++++++++++                       | 52% ~11s          
  |+++++++++++++++++++++++++++                       | 53% ~11s          
  |++++++++++++++++++++++++++++                      | 54% ~11s          
  |++++++++++++++++++++++++++++                      | 55% ~11s          
  |+++++++++++++++++++++++++++++                     | 56% ~10s          
  |+++++++++++++++++++++++++++++                     | 57% ~10s          
  |++++++++++++++++++++++++++++++                    | 58% ~10s          
  |++++++++++++++++++++++++++++++                    | 59% ~09s          
  |+++++++++++++++++++++++++++++++                   | 60% ~09s          
  |+++++++++++++++++++++++++++++++                   | 61% ~09s          
  |++++++++++++++++++++++++++++++++                  | 62% ~09s          
  |++++++++++++++++++++++++++++++++                  | 63% ~08s          
  |+++++++++++++++++++++++++++++++++                 | 64% ~08s          
  |+++++++++++++++++++++++++++++++++                 | 65% ~08s          
  |++++++++++++++++++++++++++++++++++                | 66% ~08s          
  |++++++++++++++++++++++++++++++++++                | 67% ~07s          
  |+++++++++++++++++++++++++++++++++++               | 68% ~07s          
  |+++++++++++++++++++++++++++++++++++               | 69% ~07s          
  |++++++++++++++++++++++++++++++++++++              | 70% ~07s          
  |++++++++++++++++++++++++++++++++++++              | 71% ~06s          
  |+++++++++++++++++++++++++++++++++++++             | 72% ~06s          
  |+++++++++++++++++++++++++++++++++++++             | 73% ~06s          
  |++++++++++++++++++++++++++++++++++++++            | 74% ~06s          
  |++++++++++++++++++++++++++++++++++++++            | 76% ~06s          
  |+++++++++++++++++++++++++++++++++++++++           | 77% ~05s          
  |+++++++++++++++++++++++++++++++++++++++           | 78% ~05s          
  |++++++++++++++++++++++++++++++++++++++++          | 79% ~05s          
  |++++++++++++++++++++++++++++++++++++++++          | 80% ~05s          
  |+++++++++++++++++++++++++++++++++++++++++         | 81% ~04s          
  |+++++++++++++++++++++++++++++++++++++++++         | 82% ~04s          
  |++++++++++++++++++++++++++++++++++++++++++        | 83% ~04s          
  |++++++++++++++++++++++++++++++++++++++++++        | 84% ~04s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 85% ~03s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 86% ~03s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 87% ~03s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 88% ~03s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 89% ~03s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 90% ~02s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 91% ~02s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 92% ~02s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 93% ~02s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 94% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 95% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 96% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=23s  
Calculating cluster 2

  |                                                  | 0 % ~calculating  
  |+                                                 | 1 % ~09s          
  |++                                                | 2 % ~09s          
  |++                                                | 3 % ~08s          
  |+++                                               | 4 % ~08s          
  |+++                                               | 5 % ~08s          
  |++++                                              | 7 % ~08s          
  |++++                                              | 8 % ~08s          
  |+++++                                             | 9 % ~08s          
  |+++++                                             | 10% ~09s          
  |++++++                                            | 11% ~08s          
  |+++++++                                           | 12% ~08s          
  |+++++++                                           | 13% ~08s          
  |++++++++                                          | 14% ~08s          
  |++++++++                                          | 15% ~08s          
  |+++++++++                                         | 16% ~07s          
  |+++++++++                                         | 18% ~07s          
  |++++++++++                                        | 19% ~07s          
  |++++++++++                                        | 20% ~07s          
  |+++++++++++                                       | 21% ~07s          
  |+++++++++++                                       | 22% ~07s          
  |++++++++++++                                      | 23% ~07s          
  |+++++++++++++                                     | 24% ~07s          
  |+++++++++++++                                     | 25% ~07s          
  |++++++++++++++                                    | 26% ~07s          
  |++++++++++++++                                    | 27% ~06s          
  |+++++++++++++++                                   | 29% ~06s          
  |+++++++++++++++                                   | 30% ~06s          
  |++++++++++++++++                                  | 31% ~06s          
  |++++++++++++++++                                  | 32% ~06s          
  |+++++++++++++++++                                 | 33% ~06s          
  |++++++++++++++++++                                | 34% ~06s          
  |++++++++++++++++++                                | 35% ~06s          
  |+++++++++++++++++++                               | 36% ~06s          
  |+++++++++++++++++++                               | 37% ~06s          
  |++++++++++++++++++++                              | 38% ~05s          
  |++++++++++++++++++++                              | 40% ~05s          
  |+++++++++++++++++++++                             | 41% ~05s          
  |+++++++++++++++++++++                             | 42% ~05s          
  |++++++++++++++++++++++                            | 43% ~05s          
  |++++++++++++++++++++++                            | 44% ~05s          
  |+++++++++++++++++++++++                           | 45% ~05s          
  |++++++++++++++++++++++++                          | 46% ~05s          
  |++++++++++++++++++++++++                          | 47% ~05s          
  |+++++++++++++++++++++++++                         | 48% ~05s          
  |+++++++++++++++++++++++++                         | 49% ~04s          
  |++++++++++++++++++++++++++                        | 51% ~04s          
  |++++++++++++++++++++++++++                        | 52% ~04s          
  |+++++++++++++++++++++++++++                       | 53% ~04s          
  |+++++++++++++++++++++++++++                       | 54% ~04s          
  |++++++++++++++++++++++++++++                      | 55% ~04s          
  |+++++++++++++++++++++++++++++                     | 56% ~04s          
  |+++++++++++++++++++++++++++++                     | 57% ~04s          
  |++++++++++++++++++++++++++++++                    | 58% ~04s          
  |++++++++++++++++++++++++++++++                    | 59% ~04s          
  |+++++++++++++++++++++++++++++++                   | 60% ~03s          
  |+++++++++++++++++++++++++++++++                   | 62% ~03s          
  |++++++++++++++++++++++++++++++++                  | 63% ~03s          
  |++++++++++++++++++++++++++++++++                  | 64% ~03s          
  |+++++++++++++++++++++++++++++++++                 | 65% ~03s          
  |+++++++++++++++++++++++++++++++++                 | 66% ~03s          
  |++++++++++++++++++++++++++++++++++                | 67% ~03s          
  |+++++++++++++++++++++++++++++++++++               | 68% ~03s          
  |+++++++++++++++++++++++++++++++++++               | 69% ~03s          
  |++++++++++++++++++++++++++++++++++++              | 70% ~03s          
  |++++++++++++++++++++++++++++++++++++              | 71% ~02s          
  |+++++++++++++++++++++++++++++++++++++             | 73% ~02s          
  |+++++++++++++++++++++++++++++++++++++             | 74% ~02s          
  |++++++++++++++++++++++++++++++++++++++            | 75% ~02s          
  |++++++++++++++++++++++++++++++++++++++            | 76% ~02s          
  |+++++++++++++++++++++++++++++++++++++++           | 77% ~02s          
  |++++++++++++++++++++++++++++++++++++++++          | 78% ~02s          
  |++++++++++++++++++++++++++++++++++++++++          | 79% ~02s          
  |+++++++++++++++++++++++++++++++++++++++++         | 80% ~02s          
  |+++++++++++++++++++++++++++++++++++++++++         | 81% ~02s          
  |++++++++++++++++++++++++++++++++++++++++++        | 82% ~02s          
  |++++++++++++++++++++++++++++++++++++++++++        | 84% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 85% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 86% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 87% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 88% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 89% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 90% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 91% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 92% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 93% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 95% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 96% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=09s  
Calculating cluster 3

  |                                                  | 0 % ~calculating  
  |+                                                 | 1 % ~27s          
  |++                                                | 2 % ~28s          
  |++                                                | 3 % ~30s          
  |+++                                               | 4 % ~29s          
  |+++                                               | 5 % ~28s          
  |++++                                              | 6 % ~28s          
  |++++                                              | 7 % ~27s          
  |+++++                                             | 8 % ~27s          
  |+++++                                             | 9 % ~26s          
  |++++++                                            | 10% ~26s          
  |++++++                                            | 11% ~26s          
  |+++++++                                           | 12% ~26s          
  |+++++++                                           | 14% ~27s          
  |++++++++                                          | 15% ~26s          
  |++++++++                                          | 16% ~26s          
  |+++++++++                                         | 17% ~25s          
  |+++++++++                                         | 18% ~25s          
  |++++++++++                                        | 19% ~24s          
  |++++++++++                                        | 20% ~24s          
  |+++++++++++                                       | 21% ~24s          
  |+++++++++++                                       | 22% ~24s          
  |++++++++++++                                      | 23% ~23s          
  |++++++++++++                                      | 24% ~23s          
  |+++++++++++++                                     | 25% ~23s          
  |++++++++++++++                                    | 26% ~22s          
  |++++++++++++++                                    | 27% ~22s          
  |+++++++++++++++                                   | 28% ~22s          
  |+++++++++++++++                                   | 29% ~21s          
  |++++++++++++++++                                  | 30% ~21s          
  |++++++++++++++++                                  | 31% ~21s          
  |+++++++++++++++++                                 | 32% ~21s          
  |+++++++++++++++++                                 | 33% ~20s          
  |++++++++++++++++++                                | 34% ~20s          
  |++++++++++++++++++                                | 35% ~20s          
  |+++++++++++++++++++                               | 36% ~19s          
  |+++++++++++++++++++                               | 38% ~19s          
  |++++++++++++++++++++                              | 39% ~19s          
  |++++++++++++++++++++                              | 40% ~19s          
  |+++++++++++++++++++++                             | 41% ~18s          
  |+++++++++++++++++++++                             | 42% ~18s          
  |++++++++++++++++++++++                            | 43% ~18s          
  |++++++++++++++++++++++                            | 44% ~17s          
  |+++++++++++++++++++++++                           | 45% ~17s          
  |+++++++++++++++++++++++                           | 46% ~17s          
  |++++++++++++++++++++++++                          | 47% ~16s          
  |++++++++++++++++++++++++                          | 48% ~16s          
  |+++++++++++++++++++++++++                         | 49% ~16s          
  |+++++++++++++++++++++++++                         | 50% ~15s          
  |++++++++++++++++++++++++++                        | 51% ~15s          
  |+++++++++++++++++++++++++++                       | 52% ~15s          
  |+++++++++++++++++++++++++++                       | 53% ~15s          
  |++++++++++++++++++++++++++++                      | 54% ~14s          

The min.pct argument requires a feature to be detected at a minimum percentage in either of the two groups of cells, and the thresh.test argument requires a feature to be differentially expressed (on average) by some amount between the two groups.

Here, since our purpose for getting maker genes is to define the cluster and decide which one would be the contamination, so we will take only top 50 marker of individual clusters.

top50 <- seuset.markers %>% group_by(cluster) %>% top_n(n = 50, wt = avg_log2FC)
head(top50)

For check-up, we could export it as .csv file format.

write.table(top50, "Top50_Markers_cluster.csv", quote=F, sep=",", row.names=F, col.names=T)

Violin plot

Not only with the FindAllMarkers function, Seurat provides several tools for visualizing marker expression. The first one is called violin plot.

For VlnPlot(), we could put several genes by using combination, c().

Feature plot

What if we would like to see the gene expression on the UMAP directly, rather than checking the violin plot? FeaturePlot() will help you! It is exactly same as VlnPlot().

For the long list of genes

Putting three or four genes in the function using c() would not be something bothered. However, what if we have like 20 genes to check? In this case, we could declare the list of genes we would like to see, then make the plotting as loop!

gene_list <- c("Pdgfra", "Vim", "Zeb2", "Itgb1", "Itga6", "Epcam", "Prom1", "Ly6a", "Foxa1", "Prlr", "Myb", "Cited1", "Pgr", "Tspan1", "Esr1", "Elf5", "Kit", "Krt8", "Krt18", "Krt19", "Krt7", "Cldn4", "Cdh1")

Loop for Feature plot

feature <- function(x) {
  
  FeaturePlot(seuset,features =x)
}

dir.create("Feature")
pathdir <- file.path("Feature")

for (i in 1:length(gene_list)){
  feature(gene_list[i])
  ggsave(path = pathdir, paste(gene_list[i],"_FeaturePlot.pdf",sep=""), width = 20, height = 20, units = "cm")
}

Loop for Violin plot

violin <- function(x) {
      
  VlnPlot(seuset, features = x)
}

dir.create("Violin")
pathdir <- file.path("Violin")

for (i in 1:length(gene_list)){
  violin(gene_list[i])
  ggsave(path = pathdir, paste(gene_list[i],"_ViolinPlot.pdf",sep=""), width = 20, height = 20, units = "cm")
}

Take the clusters which we need

Based on the marker genes, we could clarify which clusters are the one we need to keep for the further analysis. If yes, what we should do is taking the clusters which we would like to keep from the Seurat object which we used for the clustering.

In this example, among the initial clusters, what we need are 1, 3 and 8. Therefore, we will only take those three clusters and re-cluster it.

names(seuset@meta.data)
[1] "orig.ident"      "nCount_RNA"      "nFeature_RNA"    "percent.mt"      "RNA_snn_res.0.3" "seurat_clusters"

On the meta.data of our seurat object, the cluster information is included in RNA_snn_res.0.3.

Re-clustering

Since we take the clusters which we need, what we need to do is re-calculate the clusters and plot it on UMAP. This step is required because when we subcluster the certain clusters from the whole data, the neighbour and variability information is changed so the definition of clusters will be changed.

The first step is identification of feature genes on the selected clusters with FindVariableFeatures() function. This will find out the variability between genes and find outliers.

filt.seuset <- FindVariableFeatures(filt.seuset, selection.method = "vst", nfeatures = 1000)
Calculating gene variances
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|

Then we will scale and calculate PCs. Scale is same concept as normalization, but in Seurat, the variable features which we calculated on the previous step are used.

all.genes <- rownames(filt.seuset)
filt.seuset <- ScaleData(filt.seuset, features = all.genes)
Centering and scaling data matrix

  |                                                                                                           
  |                                                                                                     |   0%
  |                                                                                                           
  |=====                                                                                                |   5%
  |                                                                                                           
  |==========                                                                                           |  10%
  |                                                                                                           
  |==============                                                                                       |  14%
  |                                                                                                           
  |===================                                                                                  |  19%
  |                                                                                                           
  |========================                                                                             |  24%
  |                                                                                                           
  |=============================                                                                        |  29%
  |                                                                                                           
  |==================================                                                                   |  33%
  |                                                                                                           
  |======================================                                                               |  38%
  |                                                                                                           
  |===========================================                                                          |  43%
  |                                                                                                           
  |================================================                                                     |  48%
  |                                                                                                           
  |=====================================================                                                |  52%
  |                                                                                                           
  |==========================================================                                           |  57%
  |                                                                                                           
  |===============================================================                                      |  62%
  |                                                                                                           
  |===================================================================                                  |  67%
  |                                                                                                           
  |========================================================================                             |  71%
  |                                                                                                           
  |=============================================================================                        |  76%
  |                                                                                                           
  |==================================================================================                   |  81%
  |                                                                                                           
  |=======================================================================================              |  86%
  |                                                                                                           
  |===========================================================================================          |  90%
  |                                                                                                           
  |================================================================================================     |  95%
  |                                                                                                           
  |=====================================================================================================| 100%
filt.seuset <- RunPCA(filt.seuset, features = VariableFeatures(object = filt.seuset))
PC_ 1 
Positive:  Ptn, Phyh, Prlr, Cited1, Gipc2, Cd164, Gpx3, Tspan1, Slc12a2, Cldn10 
       Dnajc12, Cd200, AW112010, Wfdc2, Cxcl15, Itih5, Tmem56, Tmem158, Col8a1, Slc7a2 
       Areg, Stc2, Aqp5, Ifitm3, Hmgcs2, Fgfr2, Tspan13, Cdo1, Calca, Samd5 
Negative:  Trf, Dbi, Mfge8, Wfdc18, Mgst1, Muc15, Lcn2, Plet1, Rbp1, Csn3 
       Phlda1, Plb1, Elf5, Csn1s1, Muc4, Csn2, Atp2b1, Cebpb, Plin2, Kcnn4 
       Dmkn, Ptges, Cd14, C3, Bcl2l15, Crabp2, Csn1s2a, Ceacam1, Slc28a3, Cdc42ep3 
PC_ 2 
Positive:  Sparc, Aebp1, Postn, Cxcl14, Cald1, Tpm2, Col4a2, Col4a1, Mmp2, Acta2 
       Palld, Rnase4, Bgn, Mylk, Tgfbr3, Krt5, Tagln, Thbs1, Krt14, Gja1 
       Myh11, Scn7a, Adamts1, Fst, Krt17, Fstl1, Apoe, Igfbp7, Vim, Cxcl12 
Negative:  Clu, Cldn4, Prlr, Aqp5, Cd164, Basp1, Wnt4, Tspan1, Dnajc12, AW112010 
       Wfdc2, Gipc2, Phyh, Cited1, Tspan13, Cxcl15, Bik, Cldn10, Slc12a2, Anxa1 
       Cd14, Glul, Cdo1, Clta, Hist1h2bc, Prss22, Tmem56, Tmed3, Col8a1, Areg 
PC_ 3 
Positive:  Acta2, Tpm2, Tagln, Krt5, Myh11, Mylk, Krt14, Krt17, Ecrg4, Cnn1 
       Myl9, Fst, Cxcl14, Il17b, Apoe, Col17a1, Tshz2, Mia, Palld, Tenm2 
       Id4, Lmo1, Has2, Phlda3, Cotl1, Lhfp, Nrg1, Lama3, Wif1, Pltp 
Negative:  Mfap5, Lama2, Ccdc80, Lum, Dpep1, Rarres2, Abca8a, Tnfaip6, Col3a1, Sparcl1 
       Col1a1, Col1a2, Serpinf1, Htra3, Loxl1, Hsd11b1, Igfbp6, Col15a1, Cpxm1, Tnxb 
       Pla1a, Efemp1, Col6a1, Lpl, Lox, Col6a2, Col5a3, Ctsk, Srpx, Ifi205 
PC_ 4 
Positive:  Ctsl, Mt1, Mt2, Crispld2, Chil1, Igfbp5, Tgfbr3, Ecrg4, Lcn2, Fkbp11 
       Gm47533, Cebpd, Upk3a, Lbp, Cxcl12, Mgp, Myh11, Fmod, Pdlim3, Fabp5 
       Dcn, Ackr3, Emid1, Mia, Mylk, Csn1s2a, Sgk1, Pir, Htra1, Krt14 
Negative:  Srgn, Ptprc, Cd52, Ms4a4b, Cd53, Rac2, Coro1a, Laptm5, Cd3g, Neurl3 
       Fxyd5, Gimap6, Cd2, Il2rg, Txk, Satb1, Gpr183, P2ry10, Ccr7, Gimap3 
       Cd3d, Stk17b, Cd28, Ms4a6b, Icos, Il7r, Hcst, Trac, Trbc2, Itk 
PC_ 5 
Positive:  Csn1s2a, Lalba, Csn2, Folr1, Spp1, Csn1s1, Lipa, Plin2, BC018473, Cited2 
       Lrg1, Thrsp, Csn3, Fabp3, Glycam1, Ctsl, Ldha, Dab2, Igfbp5, Abhd5 
       Emid1, Fth1, Mt1, Gm1673, Scd1, Chpt1, Lbp, Ceacam10, Fkbp11, Lao1 
Negative:  Sncg, Fcgbp, Lgals3, Aldh1a3, Cryab, Tnfaip2, Crip1, Emp1, Gas6, Ltf 
       Alox12e, Ccnd1, Baiap2, Sfn, Barx2, Rspo1, Jdp2, Bbox1, Pkp1, Atp2b1 
       Alox15, Kit, Cnmd, S100a6, Pdlim1, Tm4sf1, S100a14, Cytip, Rnase1, Lypd3 

Still, we could use 30 PCs on the subclusters. The further steps are exactly same as the one we did on the pre-proceeded datasets.

filt.seuset <- FindNeighbors(filt.seuset, dims = 1:30, k.param = 5)
Computing nearest neighbor graph
Computing SNN
filt.seuset <- FindClusters(filt.seuset, resolution = 0.3)
Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck

Number of nodes: 1473
Number of edges: 17014

Running Louvain algorithm...
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Maximum modularity in 10 random starts: 0.9158
Number of communities: 10
Elapsed time: 0 seconds
filt.seuset <- RunUMAP(filt.seuset, dims = 1:30)
15:18:48 UMAP embedding parameters a = 0.9922 b = 1.112
15:18:48 Read 1473 rows and found 30 numeric columns
15:18:48 Using Annoy for neighbor search, n_neighbors = 30
15:18:48 Building Annoy index with metric = cosine, n_trees = 50
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
15:18:48 Writing NN index file to temp file /var/folders/fb/63zhxstn6bvc52qb8hgjc1c40000gn/T//Rtmpm8BWxh/file2d6779c94d2b
15:18:48 Searching Annoy index using 1 thread, search_k = 3000
15:18:49 Annoy recall = 100%
15:18:49 Commencing smooth kNN distance calibration using 1 thread
15:18:50 Initializing from normalized Laplacian + noise
15:18:50 Commencing optimization for 500 epochs, with 60890 positive edges
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
15:18:52 Optimization finished
DimPlot(filt.seuset, reduction = "umap",label = T,label.size = 4)

For annotation of each cluster

Okay, now we have the clusters with selected ones on the UMAP. Still, we need to annotate which cluster is composed of which one.

Finding differentially expressed features

Seurat can help you find markers that define clusters via differential expression. By default, it identifies positive and negative markers of a single cluster, compared to all other cells.

seuset.filt.markers <- FindAllMarkers(filt.seuset, only.pos = TRUE, min.pct = 0.25, logfc.threshold = 0.25)
Calculating cluster 0

  |                                                  | 0 % ~calculating  
  |+                                                 | 1 % ~03s          
  |++                                                | 2 % ~02s          
  |++                                                | 3 % ~02s          
  |+++                                               | 4 % ~03s          
  |+++                                               | 5 % ~03s          
  |++++                                              | 6 % ~03s          
  |++++                                              | 7 % ~03s          
  |+++++                                             | 8 % ~03s          
  |+++++                                             | 9 % ~03s          
  |++++++                                            | 10% ~03s          
  |++++++                                            | 11% ~03s          
  |+++++++                                           | 12% ~03s          
  |+++++++                                           | 14% ~03s          
  |++++++++                                          | 15% ~03s          
  |++++++++                                          | 16% ~03s          
  |+++++++++                                         | 17% ~03s          
  |+++++++++                                         | 18% ~03s          
  |++++++++++                                        | 19% ~03s          
  |++++++++++                                        | 20% ~03s          
  |+++++++++++                                       | 21% ~03s          
  |+++++++++++                                       | 22% ~03s          
  |++++++++++++                                      | 23% ~03s          
  |++++++++++++                                      | 24% ~03s          
  |+++++++++++++                                     | 25% ~03s          
  |++++++++++++++                                    | 26% ~03s          
  |++++++++++++++                                    | 27% ~03s          
  |+++++++++++++++                                   | 28% ~02s          
  |+++++++++++++++                                   | 29% ~02s          
  |++++++++++++++++                                  | 30% ~02s          
  |++++++++++++++++                                  | 31% ~02s          
  |+++++++++++++++++                                 | 32% ~02s          
  |+++++++++++++++++                                 | 33% ~02s          
  |++++++++++++++++++                                | 34% ~02s          
  |++++++++++++++++++                                | 35% ~02s          
  |+++++++++++++++++++                               | 36% ~02s          
  |+++++++++++++++++++                               | 38% ~02s          
  |++++++++++++++++++++                              | 39% ~02s          
  |++++++++++++++++++++                              | 40% ~02s          
  |+++++++++++++++++++++                             | 41% ~02s          
  |+++++++++++++++++++++                             | 42% ~02s          
  |++++++++++++++++++++++                            | 43% ~02s          
  |++++++++++++++++++++++                            | 44% ~02s          
  |+++++++++++++++++++++++                           | 45% ~02s          
  |+++++++++++++++++++++++                           | 46% ~02s          
  |++++++++++++++++++++++++                          | 47% ~02s          
  |++++++++++++++++++++++++                          | 48% ~02s          
  |+++++++++++++++++++++++++                         | 49% ~02s          
  |+++++++++++++++++++++++++                         | 50% ~02s          
  |++++++++++++++++++++++++++                        | 51% ~02s          
  |+++++++++++++++++++++++++++                       | 52% ~02s          
  |+++++++++++++++++++++++++++                       | 53% ~02s          
  |++++++++++++++++++++++++++++                      | 54% ~02s          
  |++++++++++++++++++++++++++++                      | 55% ~02s          
  |+++++++++++++++++++++++++++++                     | 56% ~02s          
  |+++++++++++++++++++++++++++++                     | 57% ~02s          
  |++++++++++++++++++++++++++++++                    | 58% ~01s          
  |++++++++++++++++++++++++++++++                    | 59% ~01s          
  |+++++++++++++++++++++++++++++++                   | 60% ~01s          
  |+++++++++++++++++++++++++++++++                   | 61% ~01s          
  |++++++++++++++++++++++++++++++++                  | 62% ~01s          
  |++++++++++++++++++++++++++++++++                  | 64% ~01s          
  |+++++++++++++++++++++++++++++++++                 | 65% ~01s          
  |+++++++++++++++++++++++++++++++++                 | 66% ~01s          
  |++++++++++++++++++++++++++++++++++                | 67% ~01s          
  |++++++++++++++++++++++++++++++++++                | 68% ~01s          
  |+++++++++++++++++++++++++++++++++++               | 69% ~01s          
  |+++++++++++++++++++++++++++++++++++               | 70% ~01s          
  |++++++++++++++++++++++++++++++++++++              | 71% ~01s          
  |++++++++++++++++++++++++++++++++++++              | 72% ~01s          
  |+++++++++++++++++++++++++++++++++++++             | 73% ~01s          
  |+++++++++++++++++++++++++++++++++++++             | 74% ~01s          
  |++++++++++++++++++++++++++++++++++++++            | 75% ~01s          
  |+++++++++++++++++++++++++++++++++++++++           | 76% ~01s          
  |+++++++++++++++++++++++++++++++++++++++           | 77% ~01s          
  |++++++++++++++++++++++++++++++++++++++++          | 78% ~01s          
  |++++++++++++++++++++++++++++++++++++++++          | 79% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++         | 80% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++         | 81% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++        | 82% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++        | 83% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 84% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 85% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 86% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 88% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 89% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 90% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 91% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 92% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 93% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 94% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 95% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 96% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=04s  
Calculating cluster 1

  |                                                  | 0 % ~calculating  
  |+                                                 | 1 % ~04s          
  |++                                                | 2 % ~04s          
  |++                                                | 3 % ~04s          
  |+++                                               | 4 % ~04s          
  |+++                                               | 5 % ~04s          
  |++++                                              | 6 % ~04s          
  |++++                                              | 8 % ~04s          
  |+++++                                             | 9 % ~04s          
  |+++++                                             | 10% ~04s          
  |++++++                                            | 11% ~04s          
  |++++++                                            | 12% ~04s          
  |+++++++                                           | 13% ~04s          
  |+++++++                                           | 14% ~04s          
  |++++++++                                          | 15% ~04s          
  |+++++++++                                         | 16% ~04s          
  |+++++++++                                         | 17% ~04s          
  |++++++++++                                        | 18% ~04s          
  |++++++++++                                        | 19% ~03s          
  |+++++++++++                                       | 20% ~03s          
  |+++++++++++                                       | 22% ~03s          
  |++++++++++++                                      | 23% ~03s          
  |++++++++++++                                      | 24% ~03s          
  |+++++++++++++                                     | 25% ~03s          
  |+++++++++++++                                     | 26% ~03s          
  |++++++++++++++                                    | 27% ~03s          
  |++++++++++++++                                    | 28% ~03s          
  |+++++++++++++++                                   | 29% ~03s          
  |++++++++++++++++                                  | 30% ~03s          
  |++++++++++++++++                                  | 31% ~03s          
  |+++++++++++++++++                                 | 32% ~03s          
  |+++++++++++++++++                                 | 33% ~03s          
  |++++++++++++++++++                                | 34% ~03s          
  |++++++++++++++++++                                | 35% ~03s          
  |+++++++++++++++++++                               | 37% ~03s          
  |+++++++++++++++++++                               | 38% ~03s          
  |++++++++++++++++++++                              | 39% ~03s          
  |++++++++++++++++++++                              | 40% ~03s          
  |+++++++++++++++++++++                             | 41% ~03s          
  |+++++++++++++++++++++                             | 42% ~03s          
  |++++++++++++++++++++++                            | 43% ~03s          
  |+++++++++++++++++++++++                           | 44% ~02s          
  |+++++++++++++++++++++++                           | 45% ~02s          
  |++++++++++++++++++++++++                          | 46% ~02s          
  |++++++++++++++++++++++++                          | 47% ~02s          
  |+++++++++++++++++++++++++                         | 48% ~02s          
  |+++++++++++++++++++++++++                         | 49% ~02s          
  |++++++++++++++++++++++++++                        | 51% ~02s          
  |++++++++++++++++++++++++++                        | 52% ~02s          
  |+++++++++++++++++++++++++++                       | 53% ~02s          
  |+++++++++++++++++++++++++++                       | 54% ~02s          
  |++++++++++++++++++++++++++++                      | 55% ~02s          
  |++++++++++++++++++++++++++++                      | 56% ~02s          
  |+++++++++++++++++++++++++++++                     | 57% ~02s          
  |++++++++++++++++++++++++++++++                    | 58% ~02s          
  |++++++++++++++++++++++++++++++                    | 59% ~02s          
  |+++++++++++++++++++++++++++++++                   | 60% ~02s          
  |+++++++++++++++++++++++++++++++                   | 61% ~02s          
  |++++++++++++++++++++++++++++++++                  | 62% ~02s          
  |++++++++++++++++++++++++++++++++                  | 63% ~02s          
  |+++++++++++++++++++++++++++++++++                 | 65% ~02s          
  |+++++++++++++++++++++++++++++++++                 | 66% ~02s          
  |++++++++++++++++++++++++++++++++++                | 67% ~02s          
  |++++++++++++++++++++++++++++++++++                | 68% ~01s          
  |+++++++++++++++++++++++++++++++++++               | 69% ~01s          
  |+++++++++++++++++++++++++++++++++++               | 70% ~01s          
  |++++++++++++++++++++++++++++++++++++              | 71% ~01s          
  |+++++++++++++++++++++++++++++++++++++             | 72% ~01s          
  |+++++++++++++++++++++++++++++++++++++             | 73% ~01s          
  |++++++++++++++++++++++++++++++++++++++            | 74% ~01s          
  |++++++++++++++++++++++++++++++++++++++            | 75% ~01s          
  |+++++++++++++++++++++++++++++++++++++++           | 76% ~01s          
  |+++++++++++++++++++++++++++++++++++++++           | 77% ~01s          
  |++++++++++++++++++++++++++++++++++++++++          | 78% ~01s          
  |++++++++++++++++++++++++++++++++++++++++          | 80% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++         | 81% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++         | 82% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++        | 83% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++        | 84% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 85% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 86% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 87% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 88% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 89% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 90% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 91% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 92% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 94% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 95% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 96% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=05s  
Calculating cluster 2

  |                                                  | 0 % ~calculating  
  |+                                                 | 1 % ~04s          
  |++                                                | 2 % ~03s          
  |++                                                | 4 % ~04s          
  |+++                                               | 5 % ~04s          
  |+++                                               | 6 % ~04s          
  |++++                                              | 7 % ~04s          
  |+++++                                             | 8 % ~04s          
  |+++++                                             | 10% ~04s          
  |++++++                                            | 11% ~04s          
  |++++++                                            | 12% ~04s          
  |+++++++                                           | 13% ~04s          
  |++++++++                                          | 14% ~04s          
  |++++++++                                          | 15% ~04s          
  |+++++++++                                         | 17% ~03s          
  |+++++++++                                         | 18% ~03s          
  |++++++++++                                        | 19% ~03s          
  |+++++++++++                                       | 20% ~03s          
  |+++++++++++                                       | 21% ~03s          
  |++++++++++++                                      | 23% ~03s          
  |++++++++++++                                      | 24% ~03s          
  |+++++++++++++                                     | 25% ~03s          
  |++++++++++++++                                    | 26% ~03s          
  |++++++++++++++                                    | 27% ~03s          
  |+++++++++++++++                                   | 29% ~03s          
  |+++++++++++++++                                   | 30% ~03s          
  |++++++++++++++++                                  | 31% ~03s          
  |+++++++++++++++++                                 | 32% ~03s          
  |+++++++++++++++++                                 | 33% ~03s          
  |++++++++++++++++++                                | 35% ~03s          
  |++++++++++++++++++                                | 36% ~03s          
  |+++++++++++++++++++                               | 37% ~03s          
  |++++++++++++++++++++                              | 38% ~03s          
  |++++++++++++++++++++                              | 39% ~03s          
  |+++++++++++++++++++++                             | 40% ~03s          
  |+++++++++++++++++++++                             | 42% ~03s          
  |++++++++++++++++++++++                            | 43% ~02s          
  |+++++++++++++++++++++++                           | 44% ~02s          
  |+++++++++++++++++++++++                           | 45% ~02s          
  |++++++++++++++++++++++++                          | 46% ~02s          
  |++++++++++++++++++++++++                          | 48% ~02s          
  |+++++++++++++++++++++++++                         | 49% ~02s          
  |+++++++++++++++++++++++++                         | 50% ~02s          
  |++++++++++++++++++++++++++                        | 51% ~02s          
  |+++++++++++++++++++++++++++                       | 52% ~02s          
  |+++++++++++++++++++++++++++                       | 54% ~02s          
  |++++++++++++++++++++++++++++                      | 55% ~02s          
  |++++++++++++++++++++++++++++                      | 56% ~02s          
  |+++++++++++++++++++++++++++++                     | 57% ~02s          
  |++++++++++++++++++++++++++++++                    | 58% ~02s          
  |++++++++++++++++++++++++++++++                    | 60% ~02s          
  |+++++++++++++++++++++++++++++++                   | 61% ~02s          
  |+++++++++++++++++++++++++++++++                   | 62% ~02s          
  |++++++++++++++++++++++++++++++++                  | 63% ~02s          
  |+++++++++++++++++++++++++++++++++                 | 64% ~02s          
  |+++++++++++++++++++++++++++++++++                 | 65% ~01s          
  |++++++++++++++++++++++++++++++++++                | 67% ~01s          
  |++++++++++++++++++++++++++++++++++                | 68% ~01s          
  |+++++++++++++++++++++++++++++++++++               | 69% ~01s          
  |++++++++++++++++++++++++++++++++++++              | 70% ~01s          
  |++++++++++++++++++++++++++++++++++++              | 71% ~01s          
  |+++++++++++++++++++++++++++++++++++++             | 73% ~01s          
  |+++++++++++++++++++++++++++++++++++++             | 74% ~01s          
  |++++++++++++++++++++++++++++++++++++++            | 75% ~01s          
  |+++++++++++++++++++++++++++++++++++++++           | 76% ~01s          
  |+++++++++++++++++++++++++++++++++++++++           | 77% ~01s          
  |++++++++++++++++++++++++++++++++++++++++          | 79% ~01s          
  |++++++++++++++++++++++++++++++++++++++++          | 80% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++         | 81% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++        | 82% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++        | 83% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 85% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 86% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 87% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 88% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 89% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 90% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 92% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 93% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 94% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 95% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=04s  
Calculating cluster 3

  |                                                  | 0 % ~calculating  
  |+                                                 | 1 % ~08s          
  |++                                                | 2 % ~09s          
  |++                                                | 3 % ~09s          
  |+++                                               | 4 % ~09s          
  |+++                                               | 5 % ~08s          
  |++++                                              | 6 % ~08s          
  |++++                                              | 8 % ~08s          
  |+++++                                             | 9 % ~08s          
  |+++++                                             | 10% ~08s          
  |++++++                                            | 11% ~08s          
  |++++++                                            | 12% ~08s          
  |+++++++                                           | 13% ~08s          
  |+++++++                                           | 14% ~08s          
  |++++++++                                          | 15% ~08s          
  |+++++++++                                         | 16% ~08s          
  |+++++++++                                         | 17% ~07s          
  |++++++++++                                        | 18% ~07s          
  |++++++++++                                        | 19% ~07s          
  |+++++++++++                                       | 20% ~07s          
  |+++++++++++                                       | 22% ~07s          
  |++++++++++++                                      | 23% ~07s          
  |++++++++++++                                      | 24% ~07s          
  |+++++++++++++                                     | 25% ~07s          
  |+++++++++++++                                     | 26% ~07s          
  |++++++++++++++                                    | 27% ~06s          
  |++++++++++++++                                    | 28% ~06s          
  |+++++++++++++++                                   | 29% ~06s          
  |++++++++++++++++                                  | 30% ~06s          
  |++++++++++++++++                                  | 31% ~06s          
  |+++++++++++++++++                                 | 32% ~06s          
  |+++++++++++++++++                                 | 33% ~06s          
  |++++++++++++++++++                                | 34% ~06s          
  |++++++++++++++++++                                | 35% ~05s          
  |+++++++++++++++++++                               | 37% ~05s          
  |+++++++++++++++++++                               | 38% ~05s          
  |++++++++++++++++++++                              | 39% ~05s          
  |++++++++++++++++++++                              | 40% ~05s          
  |+++++++++++++++++++++                             | 41% ~05s          
  |+++++++++++++++++++++                             | 42% ~05s          
  |++++++++++++++++++++++                            | 43% ~05s          
  |+++++++++++++++++++++++                           | 44% ~05s          
  |+++++++++++++++++++++++                           | 45% ~04s          
  |++++++++++++++++++++++++                          | 46% ~04s          
  |++++++++++++++++++++++++                          | 47% ~04s          
  |+++++++++++++++++++++++++                         | 48% ~04s          
  |+++++++++++++++++++++++++                         | 49% ~04s          
  |++++++++++++++++++++++++++                        | 51% ~04s          
  |++++++++++++++++++++++++++                        | 52% ~04s          
  |+++++++++++++++++++++++++++                       | 53% ~04s          
  |+++++++++++++++++++++++++++                       | 54% ~04s          
  |++++++++++++++++++++++++++++                      | 55% ~04s          
  |++++++++++++++++++++++++++++                      | 56% ~03s          
  |+++++++++++++++++++++++++++++                     | 57% ~03s          
  |++++++++++++++++++++++++++++++                    | 58% ~03s          
  |++++++++++++++++++++++++++++++                    | 59% ~03s          
  |+++++++++++++++++++++++++++++++                   | 60% ~03s          
  |+++++++++++++++++++++++++++++++                   | 61% ~03s          
  |++++++++++++++++++++++++++++++++                  | 62% ~03s          
  |++++++++++++++++++++++++++++++++                  | 63% ~03s          
  |+++++++++++++++++++++++++++++++++                 | 65% ~03s          
  |+++++++++++++++++++++++++++++++++                 | 66% ~03s          
  |++++++++++++++++++++++++++++++++++                | 67% ~03s          
  |++++++++++++++++++++++++++++++++++                | 68% ~02s          
  |+++++++++++++++++++++++++++++++++++               | 69% ~02s          
  |+++++++++++++++++++++++++++++++++++               | 70% ~02s          
  |++++++++++++++++++++++++++++++++++++              | 71% ~02s          
  |+++++++++++++++++++++++++++++++++++++             | 72% ~02s          
  |+++++++++++++++++++++++++++++++++++++             | 73% ~02s          
  |++++++++++++++++++++++++++++++++++++++            | 74% ~02s          
  |++++++++++++++++++++++++++++++++++++++            | 75% ~02s          
  |+++++++++++++++++++++++++++++++++++++++           | 76% ~02s          
  |+++++++++++++++++++++++++++++++++++++++           | 77% ~02s          
  |++++++++++++++++++++++++++++++++++++++++          | 78% ~02s          
  |++++++++++++++++++++++++++++++++++++++++          | 80% ~02s          
  |+++++++++++++++++++++++++++++++++++++++++         | 81% ~02s          
  |+++++++++++++++++++++++++++++++++++++++++         | 82% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++        | 83% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++        | 84% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 85% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 86% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 87% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 88% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 89% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 90% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 91% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 92% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 94% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 95% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 96% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=08s  
Calculating cluster 4

  |                                                  | 0 % ~calculating  
  |+                                                 | 1 % ~11s          
  |+                                                 | 2 % ~10s          
  |++                                                | 3 % ~10s          
  |++                                                | 4 % ~10s          
  |+++                                               | 5 % ~11s          
  |+++                                               | 6 % ~11s          
  |++++                                              | 7 % ~11s          
  |++++                                              | 8 % ~10s          
  |+++++                                             | 9 % ~10s          
  |+++++                                             | 10% ~10s          
  |++++++                                            | 11% ~10s          
  |++++++                                            | 12% ~10s          
  |+++++++                                           | 13% ~10s          
  |+++++++                                           | 14% ~10s          
  |++++++++                                          | 15% ~09s          
  |++++++++                                          | 16% ~09s          
  |+++++++++                                         | 17% ~09s          
  |+++++++++                                         | 18% ~09s          
  |++++++++++                                        | 19% ~09s          
  |++++++++++                                        | 20% ~09s          
  |+++++++++++                                       | 21% ~09s          
  |+++++++++++                                       | 22% ~09s          
  |++++++++++++                                      | 23% ~09s          
  |++++++++++++                                      | 24% ~08s          
  |+++++++++++++                                     | 25% ~08s          
  |+++++++++++++                                     | 26% ~08s          
  |++++++++++++++                                    | 27% ~08s          
  |++++++++++++++                                    | 28% ~08s          
  |+++++++++++++++                                   | 29% ~08s          
  |+++++++++++++++                                   | 30% ~08s          
  |++++++++++++++++                                  | 31% ~08s          
  |++++++++++++++++                                  | 32% ~08s          
  |+++++++++++++++++                                 | 33% ~07s          
  |+++++++++++++++++                                 | 34% ~07s          
  |++++++++++++++++++                                | 35% ~07s          
  |++++++++++++++++++                                | 36% ~07s          
  |+++++++++++++++++++                               | 37% ~07s          
  |+++++++++++++++++++                               | 38% ~07s          
  |++++++++++++++++++++                              | 39% ~07s          
  |++++++++++++++++++++                              | 40% ~07s          
  |+++++++++++++++++++++                             | 41% ~06s          
  |+++++++++++++++++++++                             | 42% ~06s          
  |++++++++++++++++++++++                            | 43% ~06s          
  |++++++++++++++++++++++                            | 44% ~06s          
  |+++++++++++++++++++++++                           | 45% ~06s          
  |+++++++++++++++++++++++                           | 46% ~06s          
  |++++++++++++++++++++++++                          | 47% ~06s          
  |++++++++++++++++++++++++                          | 48% ~06s          
  |+++++++++++++++++++++++++                         | 49% ~06s          
  |+++++++++++++++++++++++++                         | 50% ~05s          
  |++++++++++++++++++++++++++                        | 51% ~05s          
  |++++++++++++++++++++++++++                        | 52% ~05s          
  |+++++++++++++++++++++++++++                       | 53% ~05s          
  |+++++++++++++++++++++++++++                       | 54% ~05s          
  |++++++++++++++++++++++++++++                      | 55% ~05s          
  |++++++++++++++++++++++++++++                      | 56% ~05s          
  |+++++++++++++++++++++++++++++                     | 57% ~05s          
  |+++++++++++++++++++++++++++++                     | 58% ~05s          
  |++++++++++++++++++++++++++++++                    | 59% ~04s          
  |++++++++++++++++++++++++++++++                    | 60% ~04s          
  |+++++++++++++++++++++++++++++++                   | 61% ~04s          
  |+++++++++++++++++++++++++++++++                   | 62% ~04s          
  |++++++++++++++++++++++++++++++++                  | 63% ~04s          
  |++++++++++++++++++++++++++++++++                  | 64% ~04s          
  |+++++++++++++++++++++++++++++++++                 | 65% ~04s          
  |+++++++++++++++++++++++++++++++++                 | 66% ~04s          
  |++++++++++++++++++++++++++++++++++                | 67% ~04s          
  |++++++++++++++++++++++++++++++++++                | 68% ~03s          
  |+++++++++++++++++++++++++++++++++++               | 69% ~03s          
  |+++++++++++++++++++++++++++++++++++               | 70% ~03s          
  |++++++++++++++++++++++++++++++++++++              | 71% ~03s          
  |++++++++++++++++++++++++++++++++++++              | 72% ~03s          
  |+++++++++++++++++++++++++++++++++++++             | 73% ~03s          
  |+++++++++++++++++++++++++++++++++++++             | 74% ~03s          
  |++++++++++++++++++++++++++++++++++++++            | 75% ~03s          
  |++++++++++++++++++++++++++++++++++++++            | 76% ~03s          
  |+++++++++++++++++++++++++++++++++++++++           | 77% ~03s          
  |+++++++++++++++++++++++++++++++++++++++           | 78% ~02s          
  |++++++++++++++++++++++++++++++++++++++++          | 79% ~02s          
  |++++++++++++++++++++++++++++++++++++++++          | 80% ~02s          
  |+++++++++++++++++++++++++++++++++++++++++         | 81% ~02s          
  |+++++++++++++++++++++++++++++++++++++++++         | 82% ~02s          
  |++++++++++++++++++++++++++++++++++++++++++        | 83% ~02s          
  |++++++++++++++++++++++++++++++++++++++++++        | 84% ~02s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 85% ~02s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 86% ~02s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 87% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 88% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 89% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 90% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 91% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 92% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 93% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 94% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 95% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 96% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=11s  
Calculating cluster 5

  |                                                  | 0 % ~calculating  
  |+                                                 | 1 % ~03s          
  |++                                                | 2 % ~02s          
  |++                                                | 3 % ~02s          
  |+++                                               | 4 % ~03s          
  |+++                                               | 5 % ~03s          
  |++++                                              | 6 % ~03s          
  |++++                                              | 7 % ~03s          
  |+++++                                             | 8 % ~03s          
  |+++++                                             | 9 % ~03s          
  |++++++                                            | 10% ~03s          
  |++++++                                            | 11% ~03s          
  |+++++++                                           | 12% ~03s          
  |+++++++                                           | 13% ~03s          
  |++++++++                                          | 14% ~03s          
  |++++++++                                          | 15% ~03s          
  |+++++++++                                         | 16% ~03s          
  |+++++++++                                         | 17% ~03s          
  |++++++++++                                        | 18% ~03s          
  |++++++++++                                        | 19% ~03s          
  |+++++++++++                                       | 20% ~02s          
  |+++++++++++                                       | 21% ~03s          
  |++++++++++++                                      | 22% ~03s          
  |++++++++++++                                      | 23% ~03s          
  |+++++++++++++                                     | 24% ~03s          
  |+++++++++++++                                     | 26% ~03s          
  |++++++++++++++                                    | 27% ~02s          
  |++++++++++++++                                    | 28% ~02s          
  |+++++++++++++++                                   | 29% ~02s          
  |+++++++++++++++                                   | 30% ~02s          
  |++++++++++++++++                                  | 31% ~02s          
  |++++++++++++++++                                  | 32% ~02s          
  |+++++++++++++++++                                 | 33% ~02s          
  |+++++++++++++++++                                 | 34% ~02s          
  |++++++++++++++++++                                | 35% ~02s          
  |++++++++++++++++++                                | 36% ~02s          
  |+++++++++++++++++++                               | 37% ~02s          
  |+++++++++++++++++++                               | 38% ~02s          
  |++++++++++++++++++++                              | 39% ~02s          
  |++++++++++++++++++++                              | 40% ~02s          
  |+++++++++++++++++++++                             | 41% ~02s          
  |+++++++++++++++++++++                             | 42% ~02s          
  |++++++++++++++++++++++                            | 43% ~02s          
  |++++++++++++++++++++++                            | 44% ~02s          
  |+++++++++++++++++++++++                           | 45% ~02s          
  |+++++++++++++++++++++++                           | 46% ~02s          
  |++++++++++++++++++++++++                          | 47% ~02s          
  |++++++++++++++++++++++++                          | 48% ~02s          
  |+++++++++++++++++++++++++                         | 49% ~02s          
  |+++++++++++++++++++++++++                         | 50% ~02s          
  |++++++++++++++++++++++++++                        | 51% ~02s          
  |+++++++++++++++++++++++++++                       | 52% ~02s          
  |+++++++++++++++++++++++++++                       | 53% ~02s          
  |++++++++++++++++++++++++++++                      | 54% ~02s          
  |++++++++++++++++++++++++++++                      | 55% ~02s          
  |+++++++++++++++++++++++++++++                     | 56% ~02s          
  |+++++++++++++++++++++++++++++                     | 57% ~01s          
  |++++++++++++++++++++++++++++++                    | 58% ~01s          
  |++++++++++++++++++++++++++++++                    | 59% ~01s          
  |+++++++++++++++++++++++++++++++                   | 60% ~01s          
  |+++++++++++++++++++++++++++++++                   | 61% ~01s          
  |++++++++++++++++++++++++++++++++                  | 62% ~01s          
  |++++++++++++++++++++++++++++++++                  | 63% ~01s          
  |+++++++++++++++++++++++++++++++++                 | 64% ~01s          
  |+++++++++++++++++++++++++++++++++                 | 65% ~01s          
  |++++++++++++++++++++++++++++++++++                | 66% ~01s          
  |++++++++++++++++++++++++++++++++++                | 67% ~01s          
  |+++++++++++++++++++++++++++++++++++               | 68% ~01s          
  |+++++++++++++++++++++++++++++++++++               | 69% ~01s          
  |++++++++++++++++++++++++++++++++++++              | 70% ~01s          
  |++++++++++++++++++++++++++++++++++++              | 71% ~01s          
  |+++++++++++++++++++++++++++++++++++++             | 72% ~01s          
  |+++++++++++++++++++++++++++++++++++++             | 73% ~01s          
  |++++++++++++++++++++++++++++++++++++++            | 74% ~01s          
  |++++++++++++++++++++++++++++++++++++++            | 76% ~01s          
  |+++++++++++++++++++++++++++++++++++++++           | 77% ~01s          
  |+++++++++++++++++++++++++++++++++++++++           | 78% ~01s          
  |++++++++++++++++++++++++++++++++++++++++          | 79% ~01s          
  |++++++++++++++++++++++++++++++++++++++++          | 80% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++         | 81% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++         | 82% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++        | 83% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++        | 84% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 85% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 86% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 87% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 88% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 89% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 90% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 91% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 92% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 93% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 94% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 95% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 96% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=03s  
Calculating cluster 6

  |                                                  | 0 % ~calculating  
  |+                                                 | 1 % ~04s          
  |++                                                | 2 % ~05s          
  |++                                                | 3 % ~05s          
  |+++                                               | 4 % ~05s          
  |+++                                               | 5 % ~05s          
  |++++                                              | 6 % ~05s          
  |++++                                              | 7 % ~05s          
  |+++++                                             | 8 % ~05s          
  |+++++                                             | 9 % ~05s          
  |++++++                                            | 10% ~05s          
  |++++++                                            | 11% ~05s          
  |+++++++                                           | 12% ~05s          
  |+++++++                                           | 13% ~05s          
  |++++++++                                          | 14% ~05s          
  |++++++++                                          | 15% ~05s          
  |+++++++++                                         | 16% ~05s          
  |+++++++++                                         | 17% ~05s          
  |++++++++++                                        | 18% ~05s          
  |++++++++++                                        | 19% ~05s          
  |+++++++++++                                       | 20% ~05s          
  |+++++++++++                                       | 21% ~05s          
  |++++++++++++                                      | 22% ~05s          
  |++++++++++++                                      | 23% ~05s          
  |+++++++++++++                                     | 24% ~04s          
  |+++++++++++++                                     | 25% ~04s          
  |++++++++++++++                                    | 26% ~04s          
  |++++++++++++++                                    | 27% ~04s          
  |+++++++++++++++                                   | 28% ~04s          
  |+++++++++++++++                                   | 29% ~04s          
  |++++++++++++++++                                  | 30% ~04s          
  |++++++++++++++++                                  | 31% ~04s          
  |+++++++++++++++++                                 | 32% ~04s          
  |+++++++++++++++++                                 | 33% ~04s          
  |++++++++++++++++++                                | 34% ~04s          
  |++++++++++++++++++                                | 35% ~04s          
  |+++++++++++++++++++                               | 36% ~04s          
  |+++++++++++++++++++                               | 37% ~04s          
  |++++++++++++++++++++                              | 38% ~04s          
  |++++++++++++++++++++                              | 39% ~04s          
  |+++++++++++++++++++++                             | 40% ~04s          
  |+++++++++++++++++++++                             | 41% ~04s          
  |++++++++++++++++++++++                            | 42% ~04s          
  |++++++++++++++++++++++                            | 43% ~03s          
  |+++++++++++++++++++++++                           | 44% ~03s          
  |+++++++++++++++++++++++                           | 45% ~03s          
  |++++++++++++++++++++++++                          | 46% ~03s          
  |++++++++++++++++++++++++                          | 47% ~03s          
  |+++++++++++++++++++++++++                         | 48% ~03s          
  |+++++++++++++++++++++++++                         | 49% ~03s          
  |++++++++++++++++++++++++++                        | 51% ~03s          
  |++++++++++++++++++++++++++                        | 52% ~03s          
  |+++++++++++++++++++++++++++                       | 53% ~03s          
  |+++++++++++++++++++++++++++                       | 54% ~03s          
  |++++++++++++++++++++++++++++                      | 55% ~03s          
  |++++++++++++++++++++++++++++                      | 56% ~03s          
  |+++++++++++++++++++++++++++++                     | 57% ~03s          
  |+++++++++++++++++++++++++++++                     | 58% ~03s          
  |++++++++++++++++++++++++++++++                    | 59% ~03s          
  |++++++++++++++++++++++++++++++                    | 60% ~03s          
  |+++++++++++++++++++++++++++++++                   | 61% ~03s          
  |+++++++++++++++++++++++++++++++                   | 62% ~02s          
  |++++++++++++++++++++++++++++++++                  | 63% ~02s          
  |++++++++++++++++++++++++++++++++                  | 64% ~02s          
  |+++++++++++++++++++++++++++++++++                 | 65% ~02s          
  |+++++++++++++++++++++++++++++++++                 | 66% ~02s          
  |++++++++++++++++++++++++++++++++++                | 67% ~02s          
  |++++++++++++++++++++++++++++++++++                | 68% ~02s          
  |+++++++++++++++++++++++++++++++++++               | 69% ~02s          
  |+++++++++++++++++++++++++++++++++++               | 70% ~02s          
  |++++++++++++++++++++++++++++++++++++              | 71% ~02s          
  |++++++++++++++++++++++++++++++++++++              | 72% ~02s          
  |+++++++++++++++++++++++++++++++++++++             | 73% ~02s          
  |+++++++++++++++++++++++++++++++++++++             | 74% ~02s          
  |++++++++++++++++++++++++++++++++++++++            | 75% ~02s          
  |++++++++++++++++++++++++++++++++++++++            | 76% ~02s          
  |+++++++++++++++++++++++++++++++++++++++           | 77% ~02s          
  |+++++++++++++++++++++++++++++++++++++++           | 78% ~01s          
  |++++++++++++++++++++++++++++++++++++++++          | 79% ~01s          
  |++++++++++++++++++++++++++++++++++++++++          | 80% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++         | 81% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++         | 82% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++        | 83% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++        | 84% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 85% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 86% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 87% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 88% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 89% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 90% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 91% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 92% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 93% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 94% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 95% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 96% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=07s  
Calculating cluster 7

  |                                                  | 0 % ~calculating  
  |+                                                 | 1 % ~06s          
  |+                                                 | 2 % ~07s          
  |++                                                | 3 % ~06s          
  |++                                                | 4 % ~06s          
  |+++                                               | 5 % ~06s          
  |+++                                               | 6 % ~06s          
  |++++                                              | 7 % ~06s          
  |++++                                              | 8 % ~06s          
  |+++++                                             | 9 % ~06s          
  |+++++                                             | 10% ~06s          
  |++++++                                            | 11% ~06s          
  |++++++                                            | 12% ~06s          
  |+++++++                                           | 13% ~07s          
  |+++++++                                           | 14% ~06s          
  |++++++++                                          | 15% ~06s          
  |++++++++                                          | 16% ~06s          
  |+++++++++                                         | 17% ~06s          
  |+++++++++                                         | 18% ~06s          
  |++++++++++                                        | 19% ~06s          
  |++++++++++                                        | 20% ~06s          
  |+++++++++++                                       | 21% ~06s          
  |+++++++++++                                       | 22% ~06s          
  |++++++++++++                                      | 23% ~06s          
  |++++++++++++                                      | 24% ~06s          
  |+++++++++++++                                     | 25% ~06s          
  |+++++++++++++                                     | 26% ~06s          
  |++++++++++++++                                    | 27% ~05s          
  |++++++++++++++                                    | 28% ~05s          
  |+++++++++++++++                                   | 29% ~05s          
  |+++++++++++++++                                   | 30% ~05s          
  |++++++++++++++++                                  | 31% ~05s          
  |++++++++++++++++                                  | 32% ~05s          
  |+++++++++++++++++                                 | 33% ~05s          
  |+++++++++++++++++                                 | 34% ~05s          
  |++++++++++++++++++                                | 35% ~05s          
  |++++++++++++++++++                                | 36% ~04s          
  |+++++++++++++++++++                               | 37% ~04s          
  |+++++++++++++++++++                               | 38% ~04s          
  |++++++++++++++++++++                              | 39% ~04s          
  |++++++++++++++++++++                              | 40% ~04s          
  |+++++++++++++++++++++                             | 41% ~04s          
  |+++++++++++++++++++++                             | 42% ~04s          
  |++++++++++++++++++++++                            | 43% ~04s          
  |++++++++++++++++++++++                            | 44% ~04s          
  |+++++++++++++++++++++++                           | 45% ~04s          
  |+++++++++++++++++++++++                           | 46% ~04s          
  |++++++++++++++++++++++++                          | 47% ~03s          
  |++++++++++++++++++++++++                          | 48% ~03s          
  |+++++++++++++++++++++++++                         | 49% ~03s          
  |+++++++++++++++++++++++++                         | 50% ~03s          
  |++++++++++++++++++++++++++                        | 51% ~03s          
  |++++++++++++++++++++++++++                        | 52% ~03s          
  |+++++++++++++++++++++++++++                       | 53% ~03s          
  |+++++++++++++++++++++++++++                       | 54% ~03s          
  |++++++++++++++++++++++++++++                      | 55% ~03s          
  |++++++++++++++++++++++++++++                      | 56% ~03s          
  |+++++++++++++++++++++++++++++                     | 57% ~03s          
  |+++++++++++++++++++++++++++++                     | 58% ~03s          
  |++++++++++++++++++++++++++++++                    | 59% ~03s          
  |++++++++++++++++++++++++++++++                    | 60% ~03s          
  |+++++++++++++++++++++++++++++++                   | 61% ~03s          
  |+++++++++++++++++++++++++++++++                   | 62% ~03s          
  |++++++++++++++++++++++++++++++++                  | 63% ~02s          
  |++++++++++++++++++++++++++++++++                  | 64% ~02s          
  |+++++++++++++++++++++++++++++++++                 | 65% ~02s          
  |+++++++++++++++++++++++++++++++++                 | 66% ~02s          
  |++++++++++++++++++++++++++++++++++                | 67% ~02s          
  |++++++++++++++++++++++++++++++++++                | 68% ~02s          
  |+++++++++++++++++++++++++++++++++++               | 69% ~02s          
  |+++++++++++++++++++++++++++++++++++               | 70% ~02s          
  |++++++++++++++++++++++++++++++++++++              | 71% ~02s          
  |++++++++++++++++++++++++++++++++++++              | 72% ~02s          
  |+++++++++++++++++++++++++++++++++++++             | 73% ~02s          
  |+++++++++++++++++++++++++++++++++++++             | 74% ~02s          
  |++++++++++++++++++++++++++++++++++++++            | 75% ~02s          
  |++++++++++++++++++++++++++++++++++++++            | 76% ~02s          
  |+++++++++++++++++++++++++++++++++++++++           | 77% ~01s          
  |+++++++++++++++++++++++++++++++++++++++           | 78% ~01s          
  |++++++++++++++++++++++++++++++++++++++++          | 79% ~01s          
  |++++++++++++++++++++++++++++++++++++++++          | 80% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++         | 81% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++         | 82% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++        | 83% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++        | 84% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 85% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 86% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 87% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 88% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 89% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 90% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 91% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 92% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 93% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 94% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 95% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 96% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=06s  
Calculating cluster 8

  |                                                  | 0 % ~calculating  
  |+                                                 | 1 % ~02s          
  |++                                                | 2 % ~02s          
  |++                                                | 3 % ~02s          
  |+++                                               | 4 % ~02s          
  |+++                                               | 5 % ~02s          
  |++++                                              | 6 % ~02s          
  |++++                                              | 7 % ~02s          
  |+++++                                             | 8 % ~02s          
  |+++++                                             | 9 % ~02s          
  |++++++                                            | 10% ~02s          
  |++++++                                            | 11% ~02s          
  |+++++++                                           | 12% ~02s          
  |+++++++                                           | 13% ~02s          
  |++++++++                                          | 14% ~02s          
  |++++++++                                          | 15% ~02s          
  |+++++++++                                         | 16% ~02s          
  |+++++++++                                         | 17% ~02s          
  |++++++++++                                        | 18% ~02s          
  |++++++++++                                        | 19% ~02s          
  |+++++++++++                                       | 20% ~02s          
  |+++++++++++                                       | 21% ~02s          
  |++++++++++++                                      | 22% ~03s          
  |++++++++++++                                      | 23% ~03s          
  |+++++++++++++                                     | 24% ~03s          
  |+++++++++++++                                     | 26% ~03s          
  |++++++++++++++                                    | 27% ~03s          
  |++++++++++++++                                    | 28% ~03s          
  |+++++++++++++++                                   | 29% ~03s          
  |+++++++++++++++                                   | 30% ~03s          
  |++++++++++++++++                                  | 31% ~02s          
  |++++++++++++++++                                  | 32% ~02s          
  |+++++++++++++++++                                 | 33% ~02s          
  |+++++++++++++++++                                 | 34% ~02s          
  |++++++++++++++++++                                | 35% ~02s          
  |++++++++++++++++++                                | 36% ~02s          
  |+++++++++++++++++++                               | 37% ~02s          
  |+++++++++++++++++++                               | 38% ~02s          
  |++++++++++++++++++++                              | 39% ~02s          
  |++++++++++++++++++++                              | 40% ~02s          
  |+++++++++++++++++++++                             | 41% ~02s          
  |+++++++++++++++++++++                             | 42% ~02s          
  |++++++++++++++++++++++                            | 43% ~02s          
  |++++++++++++++++++++++                            | 44% ~02s          
  |+++++++++++++++++++++++                           | 45% ~02s          
  |+++++++++++++++++++++++                           | 46% ~02s          
  |++++++++++++++++++++++++                          | 47% ~02s          
  |++++++++++++++++++++++++                          | 48% ~02s          
  |+++++++++++++++++++++++++                         | 49% ~02s          
  |+++++++++++++++++++++++++                         | 50% ~02s          
  |++++++++++++++++++++++++++                        | 51% ~02s          
  |+++++++++++++++++++++++++++                       | 52% ~02s          
  |+++++++++++++++++++++++++++                       | 53% ~02s          
  |++++++++++++++++++++++++++++                      | 54% ~02s          
  |++++++++++++++++++++++++++++                      | 55% ~02s          
  |+++++++++++++++++++++++++++++                     | 56% ~02s          
  |+++++++++++++++++++++++++++++                     | 57% ~02s          
  |++++++++++++++++++++++++++++++                    | 58% ~02s          
  |++++++++++++++++++++++++++++++                    | 59% ~01s          
  |+++++++++++++++++++++++++++++++                   | 60% ~01s          
  |+++++++++++++++++++++++++++++++                   | 61% ~01s          
  |++++++++++++++++++++++++++++++++                  | 62% ~01s          
  |++++++++++++++++++++++++++++++++                  | 63% ~01s          
  |+++++++++++++++++++++++++++++++++                 | 64% ~01s          
  |+++++++++++++++++++++++++++++++++                 | 65% ~01s          
  |++++++++++++++++++++++++++++++++++                | 66% ~01s          
  |++++++++++++++++++++++++++++++++++                | 67% ~01s          
  |+++++++++++++++++++++++++++++++++++               | 68% ~01s          
  |+++++++++++++++++++++++++++++++++++               | 69% ~01s          
  |++++++++++++++++++++++++++++++++++++              | 70% ~01s          
  |++++++++++++++++++++++++++++++++++++              | 71% ~01s          
  |+++++++++++++++++++++++++++++++++++++             | 72% ~01s          
  |+++++++++++++++++++++++++++++++++++++             | 73% ~01s          
  |++++++++++++++++++++++++++++++++++++++            | 74% ~01s          
  |++++++++++++++++++++++++++++++++++++++            | 76% ~01s          
  |+++++++++++++++++++++++++++++++++++++++           | 77% ~01s          
  |+++++++++++++++++++++++++++++++++++++++           | 78% ~01s          
  |++++++++++++++++++++++++++++++++++++++++          | 79% ~01s          
  |++++++++++++++++++++++++++++++++++++++++          | 80% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++         | 81% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++         | 82% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++        | 83% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++        | 84% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 85% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 86% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 87% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 88% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 89% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 90% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 91% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 92% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 93% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 94% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 95% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 96% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=04s  
Calculating cluster 9

  |                                                  | 0 % ~calculating  
  |+                                                 | 1 % ~03s          
  |++                                                | 2 % ~04s          
  |++                                                | 3 % ~04s          
  |+++                                               | 4 % ~04s          
  |+++                                               | 5 % ~04s          
  |++++                                              | 7 % ~04s          
  |++++                                              | 8 % ~04s          
  |+++++                                             | 9 % ~04s          
  |+++++                                             | 10% ~04s          
  |++++++                                            | 11% ~04s          
  |++++++                                            | 12% ~04s          
  |+++++++                                           | 13% ~04s          
  |++++++++                                          | 14% ~04s          
  |++++++++                                          | 15% ~04s          
  |+++++++++                                         | 16% ~04s          
  |+++++++++                                         | 17% ~04s          
  |++++++++++                                        | 18% ~04s          
  |++++++++++                                        | 20% ~04s          
  |+++++++++++                                       | 21% ~04s          
  |+++++++++++                                       | 22% ~04s          
  |++++++++++++                                      | 23% ~04s          
  |++++++++++++                                      | 24% ~04s          
  |+++++++++++++                                     | 25% ~04s          
  |++++++++++++++                                    | 26% ~04s          
  |++++++++++++++                                    | 27% ~04s          
  |+++++++++++++++                                   | 28% ~04s          
  |+++++++++++++++                                   | 29% ~04s          
  |++++++++++++++++                                  | 30% ~04s          
  |++++++++++++++++                                  | 32% ~03s          
  |+++++++++++++++++                                 | 33% ~03s          
  |+++++++++++++++++                                 | 34% ~03s          
  |++++++++++++++++++                                | 35% ~03s          
  |++++++++++++++++++                                | 36% ~03s          
  |+++++++++++++++++++                               | 37% ~03s          
  |++++++++++++++++++++                              | 38% ~03s          
  |++++++++++++++++++++                              | 39% ~03s          
  |+++++++++++++++++++++                             | 40% ~03s          
  |+++++++++++++++++++++                             | 41% ~03s          
  |++++++++++++++++++++++                            | 42% ~03s          
  |++++++++++++++++++++++                            | 43% ~03s          
  |+++++++++++++++++++++++                           | 45% ~03s          
  |+++++++++++++++++++++++                           | 46% ~03s          
  |++++++++++++++++++++++++                          | 47% ~03s          
  |++++++++++++++++++++++++                          | 48% ~03s          
  |+++++++++++++++++++++++++                         | 49% ~02s          
  |+++++++++++++++++++++++++                         | 50% ~02s          
  |++++++++++++++++++++++++++                        | 51% ~02s          
  |+++++++++++++++++++++++++++                       | 52% ~02s          
  |+++++++++++++++++++++++++++                       | 53% ~02s          
  |++++++++++++++++++++++++++++                      | 54% ~02s          
  |++++++++++++++++++++++++++++                      | 55% ~02s          
  |+++++++++++++++++++++++++++++                     | 57% ~02s          
  |+++++++++++++++++++++++++++++                     | 58% ~02s          
  |++++++++++++++++++++++++++++++                    | 59% ~02s          
  |++++++++++++++++++++++++++++++                    | 60% ~02s          
  |+++++++++++++++++++++++++++++++                   | 61% ~02s          
  |+++++++++++++++++++++++++++++++                   | 62% ~02s          
  |++++++++++++++++++++++++++++++++                  | 63% ~02s          
  |+++++++++++++++++++++++++++++++++                 | 64% ~02s          
  |+++++++++++++++++++++++++++++++++                 | 65% ~02s          
  |++++++++++++++++++++++++++++++++++                | 66% ~02s          
  |++++++++++++++++++++++++++++++++++                | 67% ~02s          
  |+++++++++++++++++++++++++++++++++++               | 68% ~01s          
  |+++++++++++++++++++++++++++++++++++               | 70% ~01s          
  |++++++++++++++++++++++++++++++++++++              | 71% ~01s          
  |++++++++++++++++++++++++++++++++++++              | 72% ~01s          
  |+++++++++++++++++++++++++++++++++++++             | 73% ~01s          
  |+++++++++++++++++++++++++++++++++++++             | 74% ~01s          
  |++++++++++++++++++++++++++++++++++++++            | 75% ~01s          
  |+++++++++++++++++++++++++++++++++++++++           | 76% ~01s          
  |+++++++++++++++++++++++++++++++++++++++           | 77% ~01s          
  |++++++++++++++++++++++++++++++++++++++++          | 78% ~01s          
  |++++++++++++++++++++++++++++++++++++++++          | 79% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++         | 80% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++         | 82% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++        | 83% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++        | 84% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 85% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 86% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 87% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 88% ~01s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 89% ~01s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 90% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 91% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 92% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 93% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 95% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 96% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=05s  

Here, not like previously, we will just take top10 genes to make a heatmap. Note that putting too much of genes on heatmap is not informative!

Also, you could save the heatmap by using ggsave() function, with setting the width and height of plot.

Violin plot

Not only with the FindAllMarkers function, Seurat provides several tools for visualizing marker expression. The first one is called violin plot.

For VlnPlot(), we could put several genes by using combination, c().

VlnPlot(filt.seuset, features = c("Esr1", "Acta2", "Elf5"), ncol=1)

Feature plot

What if we would like to see the gene expression on the UMAP directly, rather than checking the violin plot? FeaturePlot() will help you! It is exactly same as VlnPlot().

For the long list of genes

Putting three or four genes in the function using c() would not be something bothered. However, what if we have like 20 genes to check? In this case, we could declare the list of genes we would like to see, then make the plotting as loop!

Loop for Feature plot

feature <- function(x) {
  
  FeaturePlot(filt.seuset,features =x)
}

dir.create("Feature_Filt")
pathdir <- file.path("Feature_Filt")

for (i in 1:length(gene_list)){
  feature(gene_list[i])
  ggsave(path = pathdir, paste(gene_list[i],"_FeaturePlot.pdf",sep=""), width = 20, height = 20, units = "cm")
}

Loop for Violin plot

violin <- function(x) {
      
  VlnPlot(filt.seuset, features = x)
}

dir.create("Violin_Filt")
pathdir <- file.path("Violin_Filt")

for (i in 1:length(gene_list)){
  violin(gene_list[i])
  ggsave(path = pathdir, paste(gene_list[i],"_ViolinPlot.pdf",sep=""), width = 20, height = 20, units = "cm")
}
sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 11.2.2

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] magrittr_2.0.1     data.table_1.14.0  forcats_0.5.1      stringr_1.4.0      dplyr_1.0.7       
 [6] purrr_0.3.4        readr_1.4.0        tidyr_1.1.3        tibble_3.1.2       tidyverse_1.3.1   
[11] patchwork_1.1.1    ggplot2_3.3.5      SeuratObject_4.0.2 Seurat_4.0.3      

loaded via a namespace (and not attached):
  [1] Rtsne_0.15            colorspace_2.0-2      deldir_0.2-10         ellipsis_0.3.2       
  [5] ggridges_0.5.3        fs_1.5.0              rstudioapi_0.13       spatstat.data_2.1-0  
  [9] farver_2.1.0          leiden_0.3.8          listenv_0.8.0         ggrepel_0.9.1        
 [13] RSpectra_0.16-0       lubridate_1.7.10      fansi_0.5.0           xml2_1.3.2           
 [17] codetools_0.2-18      splines_4.1.0         knitr_1.33            polyclip_1.10-0      
 [21] jsonlite_1.7.2        broom_0.7.8           ica_1.0-2             cluster_2.1.2        
 [25] dbplyr_2.1.1          png_0.1-7             uwot_0.1.10           shiny_1.6.0          
 [29] sctransform_0.3.2     spatstat.sparse_2.0-0 compiler_4.1.0        httr_1.4.2           
 [33] backports_1.2.1       assertthat_0.2.1      Matrix_1.3-4          fastmap_1.1.0        
 [37] lazyeval_0.2.2        limma_3.48.1          cli_3.0.1             later_1.2.0          
 [41] htmltools_0.5.1.1     tools_4.1.0           igraph_1.2.6          gtable_0.3.0         
 [45] glue_1.4.2            RANN_2.6.1            reshape2_1.4.4        Rcpp_1.0.7           
 [49] scattermore_0.7       jquerylib_0.1.4       cellranger_1.1.0      vctrs_0.3.8          
 [53] nlme_3.1-152          lmtest_0.9-38         xfun_0.24             globals_0.14.0       
 [57] rvest_1.0.0           mime_0.11             miniUI_0.1.1.1        lifecycle_1.0.0      
 [61] irlba_2.3.3           goftest_1.2-2         future_1.21.0         MASS_7.3-54          
 [65] zoo_1.8-9             scales_1.1.1          spatstat.core_2.3-0   hms_1.1.0            
 [69] promises_1.2.0.1      spatstat.utils_2.2-0  parallel_4.1.0        RColorBrewer_1.1-2   
 [73] yaml_2.2.1            reticulate_1.20       pbapply_1.4-3         gridExtra_2.3        
 [77] sass_0.4.0            rpart_4.1-15          stringi_1.7.3         rlang_0.4.11         
 [81] pkgconfig_2.0.3       matrixStats_0.59.0    evaluate_0.14         lattice_0.20-44      
 [85] ROCR_1.0-11           tensor_1.5            labeling_0.4.2        htmlwidgets_1.5.3    
 [89] cowplot_1.1.1         tidyselect_1.1.1      parallelly_1.27.0     RcppAnnoy_0.0.18     
 [93] plyr_1.8.6            R6_2.5.0              generics_0.1.0        DBI_1.1.1            
 [97] pillar_1.6.1          haven_2.4.1           withr_2.4.2           mgcv_1.8-36          
[101] fitdistrplus_1.1-5    survival_3.2-11       abind_1.4-5           future.apply_1.7.0   
[105] modelr_0.1.8          crayon_1.4.1          KernSmooth_2.23-20    utf8_1.2.1           
[109] spatstat.geom_2.2-2   plotly_4.9.4.1        rmarkdown_2.9         readxl_1.3.1         
[113] grid_4.1.0            reprex_2.0.0          digest_0.6.27         xtable_1.8-4         
[117] httpuv_1.6.1          munsell_0.5.0         viridisLite_0.4.0     bslib_0.2.5.1        
LS0tCnRpdGxlOiAiUiBjb3Vyc2UgOiBTdW1tZXIgMjAyMSIKc3VidGl0bGUgOiAiRGF5IDUgOiBEZWFsIHdpdGggdGhlIHNpbmdsZS1jZWxsIGRhdGFzZXRzIgphdXRob3I6ICJZdXJhIFNvbmciCmRhdGU6ICd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